/****************************************Copyright (c)**************************************************
**                                         2016-03
**
**                                
**
**
**--------------File Info-------------------------------------------------------------------------------
** File name:		    ht6x1x_tbs.c
** Last modified Date:  2016-03-29
** Last Version:		v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Created by:			Evan Chen
** Created date:		2016-03-29
** Version:				v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "ht6x1x_tbs.h"

void TBS_Enable(TBS_Enable_TypeDef  enable)
{
	HT_TBS->TBSCON |= enable;
}

void TBS_Disable(TBS_Enable_TypeDef  enable)
{
	HT_TBS->TBSCON &= ~enable;
}

void TBS_EnableInterrupt(TBS_Enable_TypeDef  enable)
{
	HT_TBS->TBSIF &= ~enable;
	HT_TBS->TBSIE |= enable;
}

void TBS_DisableInterrupt(TBS_Enable_TypeDef  enable)
{
	HT_TBS->TBSIF &= ~enable;
	HT_TBS->TBSIE &= ~enable;
}

void TBS_DisableInterruptAll(void)
{
	HT_TBS->TBSIF = 0;
	HT_TBS->TBSIE = 0;
}

void TBS_SetPerdic(uint16_t prd)
{
	HT_TBS->TBSPRD = prd;
}

